﻿using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Text;

namespace WFL.Data.SqlClient
{
    public class SqlContext : Context
    {
        protected override string DefaultConnectionString
        {
            get { throw new NotSupportedException("默认连接未指定"); }
        }

        public SqlContext(string name)
            : base(name)
        { 
        
        }

        public SqlContext()
            : this("Sql")
        {

        }

        protected override IConnectionProxy Create(string connectionString)
        {
            SqlConnection connection = new SqlConnection(connectionString);
            connection.Open();
            return new SqlConnectionProxy(connection, connectionString);
        }
    }
}
